package com.sf.fy.uav.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sf.fy.uav.user.entity.UserWallet;
import com.sf.fy.uav.user.mapper.UserWalletMapper;
import com.sf.fy.uav.user.service.IUserWalletService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 钱包 服务实现类
 * </p>
 *
 * @author LTQ
 * @since 2023-08-25
 */
@Service
public class UserWalletServiceImpl extends ServiceImpl<UserWalletMapper, UserWallet> implements IUserWalletService {
    @Autowired
    private UserWalletMapper userWalletMapper;

    @Override
    public UserWallet selectOneByUserId(String userId) {
        QueryWrapper<UserWallet> userWalletQueryWrapper = new QueryWrapper<>();
        userWalletQueryWrapper.eq("user_id", userId);
        UserWallet userWallet = userWalletMapper.selectOne(userWalletQueryWrapper);
        return userWallet;
    }
}
